package cn.ctyun.ipush.web.user.dao;

import cn.ctyun.ipush.web.user.bo.City;
import com.dexcoder.dal.JdbcDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * Created by yanghongbo on 2016/7/10.
 */
@Component
public class CityDao {

    @Autowired
    private JdbcDao jdbcDao;

    public City queryCityById(String cityId){
        City city = new City();
        city.setCityId(cityId);

        city=jdbcDao.querySingleResult(city);

        if(null!=city){
            return city;
        }else{
            return null;
        }


    }
    public List<City> queryCityAll(City city){
        try{

            return jdbcDao.queryList(city);

        }catch (Exception e){
            return null;
        }
    }

}
